<?php
if(!defined('DEDEMEMBER'))
{
	exit("dedecms");
}

//验证码生成函数
function random($length, $numeric = 0)
{
	PHP_VERSION < '4.2.0' && mt_srand((double)microtime() * 1000000);
	if($numeric)
	{
		$hash = sprintf('%0'.$length.'d', mt_rand(0, pow(10, $length) - 1));
	}
	else
	{
		$hash = '';
		$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
		$max = strlen($chars) - 1;
		for($i = 0; $i < $length; $i++)
		{
			$hash .= $chars[mt_rand(0, $max)];
		}
	}
	return $hash;
}





//查询会员信息mail用户输入邮箱地址；userid用户名
function member($mb)
{
	global $db;
	$sql = "Select mb,email From #@__member where (email='$mb' or mb = '$mb')";
	$row = $db->GetOne($sql);
	if(!is_array($row))
	{
		return ShowMsg("对不起，该账号还没有注册","resetpassword.php");
		exit();
	}
	else
	{
		return '1';
	}
}


?>